// 北港物流业务接口
import request from '@/utils/request1'
// 查询司机信息列表
 function driverList(query) {
  return request({
    url: '/logistics/driver/list',
    method: 'get',

    params: query
  })
}
// 新增司机信息

export function addDriver(data) {
    return request({
      url: '/logistics/driver',
      method: 'post',
      data: data
    })
  }
//   修改司机信息
  export function updateDriver(data) {
    return request({
      url: '/logistics/driver',
      method: 'put',
      data: data
    })
  }
  // 删除司机
  export function delDriver(userId) {
    return request({
      url: '/logistics/driver/' + userId,
      method: 'delete'
    })
  }
//   获取司机信息详细信息
  export function getDriverDetail(roleId) {
    return request({
      url: '/logistics/driver/' + roleId,
      method: 'get'
    })
  }
  // 修改司机启用状态
  // /logistics/driver/editEnabled/1,2,3/1
  export function setDriverEditEnabled(data) {
    return request({
      url: '/logistics/driver/editEnabled/' + data.ids +'/'+data.isEnabled,
      method: 'put'
    })
  }
const obj = {
    driverList, 
    addDriver,
    updateDriver,
    delDriver,
    getDriverDetail,
    setDriverEditEnabled
}
export default obj 